unit BusinessLogicInterface;

interface

uses Classes, Dialogs, Windows, SysUtils, GridsEh, DBGridEh, DB;

type
  ISYSDBAccess=interface
    function GetDBConnection:TObject;
  end;

  ISYSParam=interface
    function GetSYSParam(const ParamName:string):string;
    function SetSYSParam(const ParamName,ParamValue:string):boolean;
    function AddSYSParam(const ParamName,ParamValue:string):boolean;
    function DelSYSParam(const ParamName:string):boolean;
    function GetParamList:TStringList;
  end;

  function CreateSYSDBAccess:ISYSDBAccess;
  function CreateSYSParam:ISYSParam;

  function DBGridExportToExcel(DBGridEh:TDBGridEh;FileName:string):boolean;

  var SYSDB:ISYSDBAccess;
      SYSParam:ISYSParam;

implementation

uses BusinessLogic;

function CreateSYSDBAccess:ISYSDBAccess;
begin
  result:=TADODBAccess.Create;
end;

function CreateSYSParam:ISYSParam;
begin
  result:=TSYSParam.Create;
end;

function DBGridExportToExcel(DBGridEh:TDBGridEh;FileName:string):boolean;
begin
  result:=FDBGridExportToExcel(DBGridEh, FileName);
end;

Initialization
  SYSParam:=CreateSYSParam;
  SYSDB:=CreateSYSDBAccess;

Finalization
  SYSDB:=Nil;
  SYSParam:=Nil;

end.
